package com.openbravo.ws.customers;

import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.Remote;
import java.util.HashSet;
import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import org.apache.axis.AxisFault;
import org.apache.axis.EngineConfiguration;
import org.apache.axis.client.Service;
import org.apache.axis.client.Stub;

public class WebServiceImplServiceLocator extends Service
  implements WebServiceImplService
{
  private String WebService_address = "http://localhost:8180/openbravo/services/WebService";
  private String WebServiceWSDDServiceName = "WebService";
  private HashSet ports = null;

  public WebServiceImplServiceLocator()
  {
  }

  public WebServiceImplServiceLocator(EngineConfiguration paramEngineConfiguration)
  {
    super(paramEngineConfiguration);
  }

  public WebServiceImplServiceLocator(String paramString, QName paramQName)
    throws ServiceException
  {
    super(paramString, paramQName);
  }

  public String getWebServiceAddress()
  {
    return this.WebService_address;
  }

  public String getWebServiceWSDDServiceName()
  {
    return this.WebServiceWSDDServiceName;
  }

  public void setWebServiceWSDDServiceName(String paramString)
  {
    this.WebServiceWSDDServiceName = paramString;
  }

  public WebServiceImpl getWebService()
    throws ServiceException
  {
    URL localURL;
    try
    {
      localURL = new URL(this.WebService_address);
    }
    catch (MalformedURLException localMalformedURLException)
    {
      throw new ServiceException(localMalformedURLException);
    }
    return getWebService(localURL);
  }

  public WebServiceImpl getWebService(URL paramURL)
    throws ServiceException
  {
    try
    {
      WebServiceSoapBindingStub localWebServiceSoapBindingStub = new WebServiceSoapBindingStub(paramURL, this);
      localWebServiceSoapBindingStub.setPortName(getWebServiceWSDDServiceName());
      return localWebServiceSoapBindingStub;
    }
    catch (AxisFault localAxisFault)
    {
    }
    return null;
  }

  public void setWebServiceEndpointAddress(String paramString)
  {
    this.WebService_address = paramString;
  }

  public Remote getPort(Class paramClass)
    throws ServiceException
  {
    try
    {
      if (WebServiceImpl.class.isAssignableFrom(paramClass))
      {
        WebServiceSoapBindingStub localWebServiceSoapBindingStub = new WebServiceSoapBindingStub(new URL(this.WebService_address), this);
        localWebServiceSoapBindingStub.setPortName(getWebServiceWSDDServiceName());
        return localWebServiceSoapBindingStub;
      }
    }
    catch (Throwable localThrowable)
    {
      throw new ServiceException(localThrowable);
    }
    throw new ServiceException(new StringBuilder().append("There is no stub implementation for the interface:  ").append(paramClass == null ? "null" : paramClass.getName()).toString());
  }

  public Remote getPort(QName paramQName, Class paramClass)
    throws ServiceException
  {
    if (paramQName == null)
      return getPort(paramClass);
    String str = paramQName.getLocalPart();
    if ("WebService".equals(str))
      return getWebService();
    Remote localRemote = getPort(paramClass);
    ((Stub)localRemote).setPortName(paramQName);
    return localRemote;
  }

  public QName getServiceName()
  {
    return new QName("http://localhost:8180/openbravo/services/WebService", "WebServiceImplService");
  }

  public Iterator getPorts()
  {
    if (this.ports == null)
    {
      this.ports = new HashSet();
      this.ports.add(new QName("http://localhost:8180/openbravo/services/WebService", "WebService"));
    }
    return this.ports.iterator();
  }

  public void setEndpointAddress(String paramString1, String paramString2)
    throws ServiceException
  {
    if ("WebService".equals(paramString1))
      setWebServiceEndpointAddress(paramString2);
    else
      throw new ServiceException(new StringBuilder().append(" Cannot set Endpoint Address for Unknown Port").append(paramString1).toString());
  }

  public void setEndpointAddress(QName paramQName, String paramString)
    throws ServiceException
  {
    setEndpointAddress(paramQName.getLocalPart(), paramString);
  }
}

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.ws.customers.WebServiceImplServiceLocator
 * JD-Core Version:    0.6.0
 */